body {
    font-family: sans-serif;
    line-height: 1.6;
    margin: 20px;
    background-color: #f4f4f4;
    color: #333;
}

h1, h2 {
    color: #1a1a1a;
}

textarea {
    width: calc(100% - 22px); /* Adjust for padding and border */
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

button {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #0056b3;
}

#loading {
    margin-top: 15px;
    font-weight: bold;
    color: #0056b3;
}

.output-container {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 20px; /* Space between code and preview */
    margin-top: 20px;
}

.output-section {
    flex: 1; /* Each section takes equal space */
    min-width: 300px; /* Minimum width before wrapping */
    background-color: #fff;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#generated-code {
    display: block;
    white-space: pre-wrap; /* Wrap long lines */
    word-wrap: break-word; /* Break words if necessary */
    background-color: #e9e9e9;
    padding: 10px;
    border-radius: 4px;
    max-height: 400px; /* Limit height and add scroll */
    overflow-y: auto;
    font-family: monospace;
}

#preview-area {
    border: 1px solid #ccc;
    padding: 10px;
    min-height: 200px;
    background-color: #fdfdfd;
    overflow: auto; /* Add scroll if content overflows */
}

/* Optional: Style for iframe preview */
/*
#preview-frame {
    width: 100%;
    height: 400px;
    border: 1px solid #ccc;
    background-color: #fff;
}
*/

